<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta name="description" content="java|算法|操作系统|个人阅读思考">
<meta property="og:type" content="website">
<meta property="og:title" content="Decisivem">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="Decisivem">
<meta property="og:description" content="java|算法|操作系统|个人阅读思考">
<meta property="og:locale" content="zh-Hans">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Decisivem">
<meta name="twitter:description" content="java|算法|操作系统|个人阅读思考">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/">





  <title>Decisivem</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left 
  page-home">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Decisivem</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">全力以赴</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
      

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/03/16/第一个博客测试/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Decisivem">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Decisivem">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2019/03/16/第一个博客测试/" itemprop="url">未命名</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-03-16T19:24:04+08:00">
                2019-03-16
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h1 id="3-14-15"><a href="#3-14-15" class="headerlink" title="3/14/15"></a>3/14/15</h1><p><a name="94cca89e"></a></p>
<h1 id="集合：都支持一个interator（）方法用来迭代"><a href="#集合：都支持一个interator（）方法用来迭代" class="headerlink" title="集合：都支持一个interator（）方法用来迭代"></a>集合：都支持一个interator（）方法用来迭代</h1><p>collection 接口<br>list 接口（有序的collection）<br>Arraylist:非同步<br>linkedlist（是一个双向列表）非同步<br>stack 继承vector （栈）<br>Vector 同步的 线程安全<br><br><br>Vector和Arraylist区别对比：</p>
<ul>
<li>vector是线程同步的 Arraylist是异步的 前者更加安全后者效率更高</li>
<li>两者内部实现机制都是由数组来实现的 但是扩增机制是不一样的 vector 增长率为100% arraylisty为50%</li>
</ul>
<p>ArrayList和linkedList区别对比：</p>
<ul>
<li>内部实现机制不一样，前者是动态数组 后者是链表</li>
<li>链表查找元素 不方便 ，但删除添加元素效率高（还是得看实际情况，单条数据也有效率高的）<ul>
<li>vector一般是避免使用（内部实现缺陷）</li>
</ul>
</li>
</ul>
<p>set接口（不包含重复元素的collection）<br>如果在操作中导致 集合中两个元素相同则会引起一些问题<br>enumset：枚举专用<br>hashset：内部由hashcode实现<br>treeset：处于排序状态的set  排序可以由comparator来实现<br>hashSet和treeSet区别：</p>
<ul>
<li>前者hashcode  后者元素排序</li>
</ul>
<p>map接口：（没有继承collection接口） key value对应 只有list和set试下了collection接口<br>hashMap：（内部由单链表实现，hash表数据结构）<br>TreeMap：（红黑树的数据结构实现 实现sortedMap接口）<br>hashTable：（性能比hashMap低）<br>hashMap和TreeMap区别对比：</p>
<ul>
<li>hashmap 利用hashcode进行快速查找 如果想要有序使用TreeMap 该树是一棵平衡树</li>
</ul>
<p>hashMap和hashTable区别：</p>
<ul>
<li>hashtable是线程安全的 hashMap线程是不安全的</li>
<li>只有hashmap可以把null作为一个表的key或者value</li>
</ul>
<p>queue（队列）<br>阻塞式队列：ArrayBlockQueue. PriorityBlockingQueue. LinkedBlockingQueue<br>双端队列：ArrayDeque. LinkedBlockingDeque. LinkedList</p>
<p><a name="df1fab6f"></a></p>
<h1 id="ArrayList："><a href="#ArrayList：" class="headerlink" title="ArrayList："></a>ArrayList：</h1><p>底层使用数组<br>transient Object[] elementData;  transient关键字是用来避免序列化使用<br>源码实现<br><a name="1d2bda98"></a></p>
<h1 id="LinkedList："><a href="#LinkedList：" class="headerlink" title="LinkedList："></a>LinkedList：</h1><p>实现了deque接口 deque一个线性collection，支持在两端插入和移除元素<br><a name="8b7e03f1"></a></p>
<h1 id="HashMap"><a href="#HashMap" class="headerlink" title="HashMap:"></a>HashMap:</h1><p>初始容量：创建hash表时的容量<br>加载因子：一般为0.75 加载因子越大对空间的利用更加充分 但是查找效率会降低。太低会照成空间的浪费<br>hashmap底层实现还是一个链表 每个节点中有一个指针指向下一个节点<br> <img src="https://cdn.nlark.com/yuque/0/2019/png/217961/1552651719392-b3679af2-cec5-4719-ae6a-7090aad4a140.png#align=left&amp;display=inline&amp;height=427&amp;originHeight=427&amp;originWidth=348&amp;size=0&amp;status=done&amp;width=348" alt><br>jdk1.6之前每一个hashmap内部都拥有一个entity table数组 这个数组是实现HashMap的关键 <br>jdk1.8中内部实现跟1.6还是有蛮大区别的 初始化数组的位置不同 命名改node替代entry（链表+红黑树）<br>hashcode 在hashmap中比较重要<br><a name="6d56c57a"></a></p>
<h1 id="HashSet："><a href="#HashSet：" class="headerlink" title="HashSet："></a>HashSet：</h1><p>内部实现还是根据hashMap来实现的</p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
  </section>

  


          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <p class="site-author-name" itemprop="name">Decisivem</p>
              <p class="site-description motion-element" itemprop="description">java|算法|操作系统|个人阅读思考</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">1</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            

            

          </nav>

          

          

          
          

          
          

          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Decisivem</span>

  
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  

  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
